import request from '@/until/request'
import Vue from 'vue';


// 新增角色
export const roleAdd = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}role/add`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 角色列表
export const roleList = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}role/list`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 角色列表
export const roleAdminRoleList = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}role/adminRoleList`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
// 角色详情
export const roleDetail = (roleId) => {
  return request({
    url: `${Vue.prototype.$configURL}role/detail`,
    method: 'get',
    params: roleId,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改角色
export const roleUpdate = (role) => {
  return request({
    url: `${Vue.prototype.$configURL}role/update`,
    method: 'post',
    data: role,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 删除角色
export const roleDelete = (roleId) => {
  return request({
    url: `${Vue.prototype.$configURL}role/delete`,
    method: 'get',
    params: {roleId},
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
